/**
 * MySurfaceInfo.java
 * Copyright(C) 2014
 * creator:cuiran 2014-6-25 下午4:04:34
 */
package org.videolan.vlc.gui.video;

import org.videolan.vlc.BaseModuleInfo;
import org.videolan.vlc.POS;


import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

/**
 *  
 * @author cuiran
 * @version 1.0.0
 */
public class MySurfaceInfo extends BaseModuleInfo {

	private MySurfaceView surfaceView=null;
	@Override
	public MySurfaceView getView(Context context) {
		// TODO Auto-generated method stub
		surfaceView=new MySurfaceView(context);
		pos=new POS();
		pos.setLeft(650);
		pos.setTop(95);
		pos.setWidth(1240);
		pos.setHeight(820);
		initPosition(surfaceView, pos);
		///sata/media/jiuzai.mpg
		//udp://@239.1.1.0:1234 
		surfaceView.setVideoPath("/sata/media/jiuzai.mpg");
		
		
		return surfaceView;
	}

	/**
	 * 初始化控件的位置
	 * 
	 * @param tv
	 *            被设置的控件
	 * @param pos
	 *            控件的位置
	 */
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	void initPosition(View view, POS pos) {
		view.setX(pos.getLeft());
		view.setY(pos.getTop());
		view.setLayoutParams(new LayoutParams(pos.getWidth(), pos.getHeight()));
	}

}
